package symbol;

import java.util.HashMap;

public class LSymbolFactory
{
	private HashMap<String, LSymbolClass> symbolClasses = new HashMap<String, LSymbolClass>();
	
	private static LSymbolFactory symbolFactory = null;
	
	public LSymbolFactory(){
		
	}
	
	public boolean registerSymbolClass(LSymbolClass symbolClass){
		if(symbolClasses.containsKey(symbolClass.getSymbol()))
			return false;
		
		symbolClasses.put(symbolClass.getSymbol(), symbolClass);
		return true;
	}
	
	/*public LSymbol createSymbolofClass(LSymbolClass symbolClass){		
		LSymbolClass symbolClass = symbolClasses.get(symbol);
		if(symbolClass==null){
			symbolClass = new LSymbolClass(symbol, symbol);
		}
					
		LSymbol symbol2 = new LSymbol(symbolClass);		
		
		return symbol2;
	}*/
	
	public static LSymbolFactory getSymbolFactory(){
		if(symbolFactory==null){
			symbolFactory = new LSymbolFactory();			
		}
		
		return symbolFactory;
	}
	
	
}
